package com.kkyy.findmusic.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kkyy.findmusic.dao.NewMusicDao;
import com.kkyy.findmusic.entity.NewMusicEntity;
import com.kkyy.findmusic.service.NewMusicService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class NewMusicServiceImpl extends ServiceImpl<NewMusicDao, NewMusicEntity> implements NewMusicService {
    @Override
    public List<NewMusicEntity> getSongs() {
        List<NewMusicEntity> songs = baseMapper.selectList(new QueryWrapper<>());
        return songs;
    }

    @Override
    public List<NewMusicEntity> getSongsByType(Integer type) {
        List<NewMusicEntity> songs = baseMapper.getByType(type);
        return songs;
    }

    @Override
    public NewMusicEntity getOneBySongsId(Integer songsId) {
        return baseMapper.selectById(songsId);
    }
}